package com.mbbb.easyExcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

public class ExcelListener extends AnalysisEventListener<Student> {

    //invoke执行，一行一行读取excel内容，把读取每行内容封装对象里面
    //从第二行开始读取
    @Override
    public void invoke(Student student, AnalysisContext analysisContext) {
        System.out.println(student);
    }

    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头: "+headMap);
    }

    //读取完成excel内容之后，执行这个方法
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
